home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sprite 1984 - 1993
/
Sprite 1984 - 1993.iso
/
src
/
lib
/
c
/
etc
/
RCS
/
gtty.c,v
< prev
next >
Wrap
Text File
|
1988-12-31
|
3KB
|
138 lines
head 1.3;
branch ;
access ;
symbols ;
locks ; strict;
comment @ * @;
1.3
date 88.12.31.12.25.51; author ouster; state Exp;
branches ;
next 1.2;
1.2
date 88.07.29.17.39.32; author ouster; state Exp;
branches ;
next 1.1;
1.1
date 88.06.19.14.31.30; author ouster; state Exp;
branches ;
next ;
desc
@@
1.3
log
@Simplify so as not to need compatibility routines or Sprite kernel calls.
@
text
@/*
* gtty.c --
*
* Source for gtty procedure.
*
* Copyright 1986 Regents of the University of California
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies. The University of California
* makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without
* express or implied warranty.
*/
#ifndef lint
static char rcsid[] = "$Header: gtty.c,v 1.2 88/07/29 17:39:32 ouster Exp $ SPRITE (Berkeley)";
#endif not lint
#include <sgtty.h>
/*
*----------------------------------------------------------------------
*
* gtty --
*
* Procedure to simulate Unix gtty call.
*
* Results:
* 0 is normally returned. If an error occurred, -1 is returned
* and errno give more details. Buf is filled in with the
* terminal characteristics of fd.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
int
gtty(fd, buf)
int fd; /* File descriptor. */
struct sgttyb *buf; /* Buffer to hold tty info */
{
return ioctl(fd, TIOCGETP, buf);
}
@
1.2
log
@Lint.
@
text
@d4 1
a4 1
* Procedure to map from Unix gtty system call to Sprite.
d7 7
a13 1
* All rights reserved.
d17 1
a17 1
static char rcsid[] = "$Header: gtty.c,v 1.1 88/06/19 14:31:30 ouster Exp $ SPRITE (Berkeley)";
d20 1
a20 3
#include <sprite.h>
#include <compatInt.h>
#include <dev/tty.h>
d30 3
a32 2
* UNIX_ERROR is returned upon error, with the actual error code
* stored in errno. UNIX_SUCCESS is returned on success.
d35 1
a35 1
* buf is filled in with the terminal characteristics of the console.
d46 1
a46 10
ReturnStatus status;
status = Fs_IOControl(fd, IOC_TTY_GETP, 0, (Address) NULL,
sizeof(struct sgttyb), (Address) buf);
if (status != SUCCESS) {
errno = Compat_MapCode(status);
return(UNIX_ERROR);
}
return(UNIX_SUCCESS);
@
1.1
log
@Initial revision
@
text
@d11 1
a11 1
static char rcsid[] = "$Header: gtty.c,v 1.2 87/06/25 10:39:09 ouster Exp $ SPRITE (Berkeley)";
d43 2
a44 2
status = Fs_IOControl(fd, IOC_TTY_GETP, 0, NULL, sizeof(struct sgttyb),
(Address) buf);
@